import request from '@/utils/request'

export function factuerManage(url, method, params, type) {
  if (type == 1) {
    return request({
      url: '/api/organization' + url,
      method: method,
      data: params
    })
  } else {
    return request({
      url: '/api/organization' + url,
      method: method,
      params
    })
  }
}

export function operator(url, method, params, type) {
  if (type == 1) {
    return request({
      url: '/api/operator' + url,
      method: method,
      data: params
    })
  } else {
    return request({
      url: '/api/operator' + url,
      method: method,
      params
    })
  }
}
export function model(url, method, params, type) {
  if (type == 1) {
    return request({
      url: '/api/model' + url,
      method: method,
      data: params
    })
  } else {
    return request({
      url: '/api/model' + url,
      method: method,
      params
    })
  }
}
export function equipType(url, method, params, type) {
  if (type == 1) {
    return request({
      url: '/api/equipType' + url,
      method: method,
      data: params
    })
  } else {
    return request({
      url: '/api/equipType' + url,
      method: method,
      params
    })
  }
}
export function equipment(url, method, params, type) {
  if (type == 1) {
    return request({
      url: '/api/equip' + url,
      method: method,
      data: params
    })
  } else {
    return request({
      url: '/api/equip' + url,
      method: method,
      params
    })
  }
}
export function batchUpdate(url, method, params) {
  return request({
    url: '/api/equip' + url,
    method: method,
    data: params,
    timeout:5*60*1000
  })
}
export function region(url, data) {
  return request({
    url: '/api/region' + url,
    method: 'post',
    data
  })
}

